import request from '@/utils/request'

/**
 * 新增专业（仅管理员）
 * @param majorAddMyRequest majorAddMyRequest
 * @returns Result OK
 * @returns any Created
 * @throws ApiError
 */
export function saveUsingPost3(majorAddMyRequest) {
  return request({
    method: 'POST',
    url: '/major',
    data: majorAddMyRequest
  })
}

/**
 * 编辑专业信息
 * @param majorUpdateMyRequest majorUpdateMyRequest
 * @returns Result_string_ OK
 * @returns any Created
 * @throws ApiError
 */
export function updateUsingPut2(
  majorUpdateMyRequest
) {
  return request({
    method: 'PUT',
    url: '/major',
    data: majorUpdateMyRequest
  })
}

/**
 * 删除专业（仅管理员）
 * @param deleteRequest deleteRequest
 * @returns Result_boolean_ OK
 * @returns any Created
 * @throws ApiError
 */
export function deleteMajorUsingPost(
  deleteRequest
) {
  return request({
    method: 'POST',
    url: '/major/delete',
    data: deleteRequest
  })
}

/**
 * 专业全部查询
 * @returns Result OK
 * @returns any Created
 * @throws ApiError
 */
export function listUsingPost1() {
  return request({
    method: 'POST',
    url: '/major/list'
  })
}

/**
 * 专业分页查询
 * @param majorQueryRequest majorQueryRequest
 * @returns Result_PageResult_ OK
 * @returns any Created
 * @throws ApiError
 */
export function pageUsingPost2(data) {
  console.log('majorQueryRequest', data)
  return request({
    method: 'POST',
    url: '/major/page',
    data
  }
  )
}

/**
 * 根据id查询专业
 * @param id id
 * @returns Result_MajorUpdateMyRequest_ OK
 * @throws ApiError
 */
export function getByIdUsingGet3(
  id
) {
  return request({
    method: 'GET',
    url: `/major/${id}`
  })
}
